Skip to content

Scribble assigment#129

Open
bhaskar-everest wants to merge 21 commits into
everest-engineering:mainfrom
bhaskar-everest:scribble_assigment
Open

Scribble assigment#129
bhaskar-everest wants to merge 21 commits into
everest-engineering:mainfrom
bhaskar-everest:scribble_assigment

Conversation

@bhaskar-everest

@bhaskar-everest bhaskar-everest commented Jun 11, 2026

Copy link
Copy Markdown

Summary

Multi-Round Gameplay with Results, Restart, and Final Standings

Backend:

  • Room lifecycle: lobby → playing → round_end → lobby/game_over
  • Drawing endpoint (POST /draw, DELETE /draw) with canvas state polling
  • Guess submission with scoring, duplicate detection, and feedback
  • Host-only round end, return-to-lobby, and new round start
  • Final standings calculation when max rounds reached
  • Leave room with host transfer

Frontend:

  • Real-time canvas with color picker, drawing, and optimized stroke sync
  • GuessForm with inline feedback (correct/incorrect/already-guessed)
  • ResultPanel, Scoreboard, FinalStandings showing scores and rankings
  • RoleBadge, WordDisplay, LeaveButton components
  • LobbyPage flows: post-game lobby, host-driven start/new round
  • GamePage states: active gameplay → round results → game over with final standings
  • HTTP polling for room state and canvas updates

Specs & Docs:

  • Spec, plan, tasks, API contracts, data model for result-restart-validation (specs/004)
  • Reflection report documenting architecture decisions

Contributor

- Define loading spinner UX for create/join/refresh
- Scope game start transition (lobby->playing) into this feature
- Add room code collision retry handling
- Add drawer assignment and word selection requirements
- Add plan.md with technical context, constitution check, and project structure
- Add research.md with existing code analysis and key decisions
- Add data-model.md with entity definitions and state transitions
- Add contracts/api-v1.md with REST endpoint contracts
- Add quickstart.md with validation scenarios and curl commands
- Point AGENTS.md SPECKIT markers to plan.md
- 28 tasks across 7 phases (Setup, Foundational, US1-4, Polish)
- MVP scope: Phase 1+2+US1 (create room with host indicator)
- US3 and US4 designed for parallel execution
… game start

- Extend RoomStatus to include playing/finished
- Add hostId, secretWord to Room model, role to Participant
- Add playerName validation (non-empty, non-whitespace) via Zod
- Mark first participant as host on room creation
- Add client-side validation and loading spinners on Create/Join pages
- Add case-insensitive room code lookup and join rejection for non-lobby rooms
- Implement lobby auto-polling (2s interval) replacing manual refresh
- Show host indicator badge in participant list
- Add startGame endpoint with host check, min 2 players, role/word assignment
- Add leaveRoom endpoint with host transfer and room cleanup
- Fix API_BASE_URL (/bug suffix removed)
- Add drawer-only secretWord visibility in snapshots
- Add max 8 participants check on join, max 4 char room code validation
- Defines 4 user stories covering game start transition, drawer word visibility, deterministic drawer assignment, and deterministic word selection
- 9 functional requirements and 7 success criteria
- Covers edge cases for refresh, non-drawer draw rejection, and name trimming
…rt-drawer

- plan.md: technical context, constitution check, project structure, phases
- research.md: 6 design decisions (drawer=host, word index-based, polling, canvas)
- data-model.md: entity definitions, state transitions, validation rules
- contracts/api-v1.md: behavioral changes to start endpoint
- quickstart.md: 6 validation scenarios for two-tab testing
- AGENTS.md: updated SPECKIT marker
22 tasks across 6 phases: foundational backend fixes (T001-T004),
US1 game page + canvas (T005-T010), US2 word visibility (T011-T013),
US3 drawer assignment tests (T014-T015), US4 word selection tests (T016-T017),
and polish/validation (T018-T022)
…ased game screen

- Fix drawer assignment to host (not first non-host) per FR-001
- Add deterministic word selection via charCodeSum(code) % 5 per FR-002
- Add Canvas component with freehand brush and 8-color palette
- Add WordDisplay and RoleBadge components
- Update GamePage with role-based rendering and polling
- Add lobby-to-game auto-navigation for non-host participants
- Add backend tests for drawer assignment, word selection, host transfer
- Trim display names via Zod transform
- Add canvas, word-display, and role-badge CSS styles
- Resolve canvas delivery model (separate endpoint)
- Resolve post-round flow deferral
- Resolve network error handling on guess submission
- Add Clarifications session section with 3 Q&A items
…-interaction

- Research document with 10 design decisions (stroke format, endpoints, storage, round end detection)
- Data model with 5 new entities (Stroke, CanvasState, Guess, Score, extended Room)
- API contracts for 5 endpoints (draw, clear, guess, end-round, extended room poll)
- Quickstart validation guide with 6 testable scenarios
- Updated AGENTS.md to reference current plan
- 49 tasks across 7 phases organized by user story priority
- Foundational phase: data model types, schemas, API methods
- US1 (P1): drawing sync with canvas endpoints and polling
- US2 (P1): guess submission with feedback and guess log
- US3 (P1): scoring, round end detection, results screen
- US4 (P2): host-controlled early round end
- US5 (P3): canvas reset on round completion
…, round end)

- Drawing sync: canvas polling, stroke submission, real-time rendering
- Guess submission with correct/incorrect/already-guessed feedback
- Scoring: 100 pts per correct guess, drawer gets pts for unguessed
- Round end: auto-end when all guess correct, host can end early
- Results screen with secret word revealed, scores, guess log
- Backend: canvas store, guess validation, Zod schemas, all endpoints
- Frontend: Canvas rewrite, GuessForm, ResultPanel, Scoreboard, GamePage
- 16 new backend tests (36 total), all quickstart scenarios validated
- Edge cases: duplicate incorrect guess detection, canvas clear no-op
- Feature spec for multi-round gameplay: results viewing, lobby return,
  new round start, final standings, and participant leave flows
- Room state machine: lobby -> playing -> round_end -> lobby (or game_over)
- Max rounds = participant count, pre-game joining only
- 4 clarifications resolved in clarify session
…estart-validation

- Phase 0 research: 10 design decisions (state machine, drawer rotation,
  word cycling, endpoint design, host transfer, polling integration)
- Phase 1 data model: Room status enum extended, RoundResult/FinalStandings
  types, state machine diagram, validation rules
- Phase 1 contracts: return-to-lobby, start-round, leave endpoints;
  breaking change note for room status enum
- Phase 1 quickstart: 7 validation scenarios with curl commands
- Updated AGENTS.md to point to new plan
- 43 tasks across 7 phases: Foundational, US1 (View Round Results),
  US2 (Return to Lobby), US3 (Start New Round), US5 (End-of-Game
  Standings), US4 (Leave Room), Polish
- MVP scope: US1 only (T001-T009)
- Parallel opportunities: Foundational tasks, US4 independent
…rounds, final standings, and leave

- Extend Room status to lobby/playing/round_end/game_over replacing 'finished'
- Add RoundResult, FinalStanding types and roundCounter/maxRounds/currentDrawerIndex/wordIndex to Room model
- Rewrite endRound to compute RoundResult and detect game_over on final round
- Add return-to-lobby and start-round endpoints with Zod validation
- Implement drawer rotation (round-robin) and word cycling with skip-back guard
- Add LeaveButton component and update leave route with drawer restriction and host transfer
- Update GamePage to handle round_end, game_over, and lobby transitions
- Update LobbyPage for post-round lobby with Start New Round and Game Complete states
- Mask correct guesses in activity feed during play to prevent answer disclosure
- Add 17 new backend unit tests (53 total passing)
- Add CSS for standings-list, waiting-message, round-result-summary
Covers what the starter had, what was added, AI usage,
tradeoffs/decisions, and improvement ideas.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants